const { Schema, SchemaTypes } = require('../schema');
class Address extends Schema {
    PropertyModelDataTemplate () {
        return {
            areaId: { type: SchemaTypes.ObjectId, required: true },
            userId: { type: SchemaTypes.ObjectId, required: true },

            name: { type: SchemaTypes.String, required: true },
            phone: { type: SchemaTypes.String, required: true },
            // 用逗号分隔，如：福建省，福州市，闽侯县
            area: { type: SchemaTypes.String, required: true },
            detailedAddress: { type: SchemaTypes.String, required: true },
            isDefault: { type: SchemaTypes.Boolean, required: true, default: false },

            createTime: { type: SchemaTypes.Number, required: true, default: require('../../module/tool/time').getCurrentTimestamp() }
        };
    }
}

module.exports = Address;
